﻿using Common.Framework.Core.Extension;

namespace Common.Framework.Core.Minio
{
    /// <summary>
    /// 完整的文件地址: FileDomain/FileBucket/FilePath/StorageFileName
    /// </summary>
    public class MinioFileModel
    {
        /// <summary>
        /// 原始文件名
        /// </summary>
        public string OriginalFileName { get; set; }
        /// <summary>
        /// 存储文件名
        /// </summary>
        public string StorageFileName { get; set; }
        /// <summary>
        /// 文件所在bucket
        /// </summary>
        public string FileBucket { get; set; } = ConfigurationExtension.Configuration["MinioConfig:BucketName"];
        /// <summary>
        /// 文件路径
        /// </summary>
        public string FilePath { get; set; }
        /// <summary>
        /// 文件域名,会将配置文件中的MinioConfig:Endpoint当做默认值
        /// </summary>
        public string FileDomain { get; set; } = ConfigurationExtension.Configuration["MinioConfig:Endpoint"];
        /// <summary>
        /// 文件服务器支持的协议
        /// </summary>
        public string Protocol { get; set; } = ConfigurationExtension.Configuration["MinioConfig:Protocol"] == null ? "http" : ConfigurationExtension.Configuration["MinioConfig:Protocol"];
    }
}
